/**
 * Created by dllo on 16/9/1.
 */
var up=0;
var down=0;
$(function () {
    //点击晋级
    $(".levelUp").on("touchstart",function () {
        //给后台传一个标记,判断点晋级,
       up++;
        $.ajax({
            url:"car_api.php",
            type:"get",
            dataType:"json",
            data:{
                openid:openid,
                up:up,
                type:"up"
            },
            success:function (data) {
                console.log(data);
            }
        });

        $.ajax({
            url:"car_api.php",
            type:"get",
            dataType:"json",
            data:{
                openid:openid,
                type:"gotup"
            },
            success:function (data) {
                console.log(data);
                $(".yourName").html(data["nickname"]);
                //显示拜谢你页面
                $("#thankyou").show();
            }
        });

        //点击我也要挑战
        $(".challengeGo2").on("touchstart",function () {
            var url="https://liboyu.applinzi.com/k_28/car.php";
            window.location.href = url;
        })
    });
    //点击你丫太差了
    $(".youTooShit").on("tiuchstart",function () {
        //给后台传一个标记,判断点你丫太差
        down++;
        $.ajax({
            url:"car_api.php",
            type:"get",
            datatype:"json",
            data:{
                openid:openid,
                down:down,
                type:"down"
            },
            suncess:function (data) {
                console.log(data);
            }
        })
    })
});